package com.kfm.servlet;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet(urlPatterns = "/life", loadOnStartup = 1)
public class LifeServlet implements Servlet {

    public LifeServlet() {
        System.out.println("LifeServlet 构造方法被调用");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("LifeServlet 初始化方法被调用");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("LifeServlet 服务方法被调用");
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        System.out.println("LifeServlet 销毁方法被调用");
    }
}
